package com.jiazhong.spring.ioc.xml.生命周期;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class APP {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("shengmingzhouqi.xml");
        /*System.out.println("------------");
        // 如果是懒加载，只有在第一次使用时加载
        Person p1 = context.getBean(Person.class);
        Person p2 = context.getBean(Person.class);
        // 默认情况下，是单例模式
        System.out.println(p1 == p2);*/
        Object dc = context.getBean("c");
        System.out.println(dc);
    }
}
